package cn.edu.aynu.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import cn.edu.aynu.pojo.Customer;
import cn.edu.aynu.pojo.QueryVo;

public interface CustomerDao
{
    /*
     * 条件查询客户
     */
    // 总条数
    public int customerCountByQueryVo(QueryVo vo);
    
    // 结果集
    public List<Customer> selectCustomerListByQueryVo(QueryVo vo);
    
    // 通过ID查询客户
    @Select("select *  from customer where cust_id=#{value}")
    public Customer selectCustomerById(Integer id);
    
    // 通过ID修改客户
    public int updateCustomerById(Customer customer);
    
    // 通过ID删除客户
    @Delete("delete from customer where cust_id=#{value}")
    public int deleteCustomerById(Integer id);
    
    // 增加客户
    public void createCustomer(Customer customer);
    
    /**
     * 查询全部(演示CustomerDao映射文件可以在不同文件中)
     * 
     * @return
     * @see [类、类#方法、类#成员]
     */
    public List<Customer> getAll();
    
}
